import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path:'/',
    redirect: '/home',
  },
  {
    path:'/home',
    name: 'Home',
    component: () => import('../views/home.vue')
  },
  { 
    path: '/search',
    name: 'Search',
    component: () => import('../views/search.vue')
  }, 
  {
    path: '/book_detail',
    name: 'bookDetail',
    component: () => import('../views/bookDetail.vue')
  },
  {
    path: '/reading/:id?/:chaterNum?/must/:name?',
    name: 'Reading',
    component: () => import('../views/reading.vue')
  },
  {
    path: '/chater_list',
    name: 'chaterList',
    component: () => import('../views/chaterList.vue')
  },
  {
    path: '/sign_in',
    name: 'signIn',
    component: () => import('../views/signIn.vue')
  },
  {
    path: '/recommend',
    name: 'Recommend',
    component: () => import('../views/recommend.vue')
  },
]

const router = new VueRouter({
  routes
})

export default router
